#include <stdio.h>
#include <stdlib.h>

struct Student {
    int id;
    char *name;
    double weight;
};

typedef struct Student STU;
typedef struct Student * STU_P;

void printStudent(STU stu) {
    printf("id: %d, name: %s, weight: %.2f\n", stu.id, stu.name, stu.weight);
}

void test0() {
    struct Student stu;
    stu.id = 1;
    stu.name = "zs";
    stu.weight = 50.0;
    printStudent(stu);
}

void test1() {
    STU stu = {1001, "lisi", 50.8};
    printStudent(stu);
}

void test3() {
    STU_P stu_p = (STU_P) malloc(sizeof(STU));
    stu_p->id = 1009;
    stu_p->name = "wangwu";
    stu_p->weight = 49.8;

    printStudent(*stu_p);
}


int main() {
//    test0();
//    test1();
    test3();
    return 0;
}
